﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharpLinqTeach
{
    /// <summary>
    /// 扩展方法类
    /// </summary>
    static class ExtendMethod   //要求必须是静态类，静态方法
    {
        //int
        public static int Divistion(this int num1,int num2)
        {
            return (num1 / num2) / 2;  //特定算法（假设）
        }

        /// <summary>
        /// 扩展密封类：实现一个自定义方法
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="info1"></param>
        /// <param name="info2"></param>
        /// <returns></returns>
        public static string ShowInfo(this Equipment obj, string info1, string info2)
        {
            return $"{info1} : {obj.EquipmentName} {info2} : {obj.EquipmentType}";
        }
    }
}
